package nccu.dao.hibernate;

import nccu.dao.CallReportXmlSubmissionDao;
import nccu.model.SubmissionData;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * This class interacts with Spring's HibernateTemplate to save/delete and
 * retrieve SubmissionData objects.
 *
 * @author <a href="mailto:chris.oberle@gmail.com">Chris Oberle</a>
*/
@Repository("callReportXmlSubmissionDao")
public class CallReportXmlSubmissionDaoHibernate
        extends GenericDaoHibernate<SubmissionData, Long> implements CallReportXmlSubmissionDao {

    public CallReportXmlSubmissionDaoHibernate() {
        super(SubmissionData.class);
    }

    public List<SubmissionData> findById(Long id) {
        return getHibernateTemplate().find("from SubmissionData where id=?", id);
    }
}
